package com.dimong.www.loan.ui.base;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;

import com.dimong.loan.sdk.ui.act.BaseFragmentActivity;
import com.dimong.loan.sdk.ui.frag.BaseFragment;
import com.dimong.www.loan.R;

public class NoTitleActivity extends BaseFragmentActivity {
	private String mFragmentClass;
	private Bundle mFragmentArguments;
	private BaseFragment mFragment = null;

	@Override
	public void initIntentParam(Intent intent) {

	}

	@Override
	public void beforeInitView() {

	}

	@Override
	public int getContentView() {
		return R.layout.act_no_title;
	}

	@Override
	public void initView() {
	}

	@Override
	public void setViewStatus() {

	}

	@Override
	public void onActResume() {

	}

	@Override
	public void onActPause() {

	}

	@Override
	public void onActDestroy() {

	}

	@Override
	public void onActRestart() {

	}

	@Override
	public void onActStop() {

	}

	@Override
	public void onActStart() {
		if (mFragmentClass == null) {
			showFragment();
		}
	}

	private void showFragment() {
		mFragmentClass = getIntent().getStringExtra(":fragment_name");
		mFragmentArguments = getIntent().getBundleExtra(":fragment_args");
		mFragment = (BaseFragment) Fragment.instantiate(this, this.mFragmentClass, this.mFragmentArguments);
		FragmentTransaction localFragmentTransaction = getSupportFragmentManager().beginTransaction();
		localFragmentTransaction.replace(R.id.content, mFragment, this.mFragmentClass);
		localFragmentTransaction.commitAllowingStateLoss();
	}
}
